import React, { PureComponent } from 'react';
import { Redirect } from 'react-router-dom'
import { connect } from 'react-redux'

class Write extends PureComponent {
  render() {
    const { loginState } = this.props;
    if (loginState) {
      return (
        <div>写文章页面</div>
      )
    } else {
      return <Redirect to='/login'></Redirect>
    }
  }

  componentDidMount() {
  }
}

const mapState = state => ({
  loginState: state.getIn(['login', 'login'])
})

const mapDispatch = dispatch => ({
})

export default connect(mapState, mapDispatch)(Write)
